Port code to add a bookmark for a volume
authorFederico Mena Quintero <federico@gnome.org>
Tue, 4 Dec 2012 22:16:49 +0000 (16:16 -0600)
committerFederico Mena Quintero <federico@gnome.org>
Tue, 4 Dec 2012 22:16:49 +0000 (16:16 -0600)
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
gtk/gtkplacessidebar.c

index 754114bcdf504736c592ed211392612fd8011d71..62b24f5ef0da67a447c10fa9dd879056689aff5e 100644 (file)
@@ -2089,17 +2089,16 @@ open_shortcut_in_new_tab_cb (GtkMenuItem      *item,
        open_shortcut_from_menu (sidebar, GTK_PLACES_OPEN_MODE_NEW_TAB);
 }
 
-/* Add bookmark for the selected item */
+/* Add bookmark for the selected item - just used from mount points */
 static void
-add_bookmark (GtkPlacesSidebar *sidebar)
+add_shortcut_cb (GtkMenuItem           *item,
+                GtkPlacesSidebar *sidebar)
 {
-#if DO_NOT_COMPILE
        GtkTreeModel *model;
        GtkTreeIter iter;
        char *uri;
        char *name;
        GFile *location;
-       NautilusBookmark *bookmark;
 
        model = gtk_tree_view_get_model (sidebar->tree_view);
 
@@ -2114,25 +2113,13 @@ add_bookmark (GtkPlacesSidebar *sidebar)
                }
 
                location = g_file_new_for_uri (uri);
-               bookmark = nautilus_bookmark_new (location, name);
-
-               if (!nautilus_bookmark_list_contains (sidebar->bookmarks, bookmark)) {
-                       nautilus_bookmark_list_append (sidebar->bookmarks, bookmark);
-               }
+               if (_gtk_bookmarks_manager_insert_bookmark (sidebar->bookmarks_manager, location, -1, NULL))
+                       _gtk_bookmarks_manager_set_bookmark_label (sidebar->bookmarks_manager, location, name, NULL);
 
                g_object_unref (location);
-               g_object_unref (bookmark);
                g_free (uri);
                g_free (name);
        }
-#endif
-}
-
-static void
-add_shortcut_cb (GtkMenuItem           *item,
-                GtkPlacesSidebar *sidebar)
-{
-       add_bookmark (sidebar);
 }
 
 /* Rename the selected bookmark */